﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace POSPlus.EZBarTender
{
    public partial class ModifiedDateDialog : Form
    {
        public ModifiedDateDialog()
        {
            InitializeComponent();
        }

        private void _startDatePicker_ValueChanged(object sender, EventArgs e)
        {
            if (_startDatePicker.Value > _endDatePicker.Value)
                _endDatePicker.Value = _startDatePicker.Value;
        }

        private void _endDatePicker_ValueChanged(object sender, EventArgs e)
        {
            if (_endDatePicker.Value < _startDatePicker.Value)
                _startDatePicker.Value = _endDatePicker.Value;
        }

        public DateTime StartDate
        {
            get
            {
                return new DateTime(_startDatePicker.Value.Year, _startDatePicker.Value.Month, _startDatePicker.Value.Day, 0,0,0);
            }
        }

        public DateTime EndDate
        {
            get
            {
                return new DateTime(_endDatePicker.Value.Year, _endDatePicker.Value.Month, _endDatePicker.Value.Day, 23, 59, 59);
            }
        }
    }
}
